{template 'common/header'}
<ul class="nav nav-tabs">
    <li class="active"><a href="#">系统设置</a></li>
    <!--<li {if $operation == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('nave', array('op' => 'display'))}">管理首页导航</a></li>-->
</ul>

<script type="text/javascript">
    $(function(){
        $(':radio[name="ismail"]').click(function(){
            if(this.checked) {
                if($(this).val() == '1') {
                    $('.mail').show();
                } else {
                    $('.mail').hide();
                }
            }
        });
        $(':radio[name="sms_enable"]').click(function(){
            if(this.checked) {
                if($(this).val() == '1') {
                    $('.sms').show();
                } else {
                    $('.sms').hide();
                }
            }
        })
        $(':radio[name="isprint"]').click(function(){
            if(this.checked) {
                if($(this).val() == '1') {
                    $('.print').show();
                } else {
                    $('.print').hide();
                }
            }
        });
    });
</script>
<link rel="stylesheet" type="text/css" href="../addons/smart_ct/plugin/clockpicker/clockpicker.css" media="all">
<script type="text/javascript" src="../addons/smart_ct/plugin/clockpicker/clockpicker.js"></script>
<link rel="stylesheet" type="text/css" href="../addons/smart_ct/plugin/clockpicker/standalone.css" media="all">
<div class="main">
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default">
            <div class="panel-heading">
                基本设置
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">网站名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="title" value="{$setting['title']}" class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">搜索关键字设置</label>
                    <div class="col-sm-9">
                        <input type="text" name="searchword" value="{$setting['searchword']}" class="form-control"/>
                        <div class="help-block">多个搜索关键词请用空格符号分开</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                管理员信息提醒设置
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否信息提醒</label>
                    <div class="col-sm-9">
                        <label for="is_notice1" class="radio-inline"><input type="radio" name="is_notice" value="1" id="is_notice1" {if $setting['is_notice'] == 1}checked="true"{/if} /> 是</label>
                        &nbsp;&nbsp;&nbsp;
                        <label for="is_notice2" class="radio-inline"><input type="radio" name="is_notice" value="0" id="is_notice2"  {if empty($setting) || $setting['is_notice'] == 0}checked="true"{/if} /> 否</label>
                        <span class="help-block"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">通知用户OPENID</label>
                    <div class="col-sm-9">
                        <input type="text" name="tpluser" class="form-control" value="{$setting['tpluser']}"/>
                        <span class="help-block">请填写微信编号。系统根据微信编号获取对应公众号的openid</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">邮箱</label>
                    <div class="col-sm-9">
                        <input type="text" name="email" class="form-control" value="{$setting['email']}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">手机号</label>
                    <div class="col-sm-9">
                        <input type="text" name="sms_mobile" class="form-control" value="{$setting['sms_mobile']}" />
                        <div class="help-block">请输入要接受订单提醒的手机号码.</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                模式
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">模式</label>
                    <div class="col-sm-9">
                        <label for="mode2" class="radio-inline"><input type="radio" name="mode" value="0" id="mode2"  {if empty($setting) || $setting['mode'] == 0}checked="true"{/if} /> 多店</label>
                        <label for="mode1" class="radio-inline"><input type="radio" name="mode" value="1" id="mode1" {if $setting['mode'] == 1}checked="true"{/if} /> 单店</label>
                        <span class="help-block">选择单店模式的情况下搜索页和门店搜索栏目将会隐藏</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">默认门店</label>
                    <div class="col-sm-9">
                        <select id="storeid" name="storeid" class="form-control">
                            {loop $stores $item}
                            <option value="{$item['id']}" {if $item['id']==$setting['storeid']}selected{/if}>{$item['title']}</option>
                            {/loop}
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                模版消息通知
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">是否开启</label>
                    <div class="col-sm-9">
                        <label for="isshow1" class="radio-inline"><input type="radio" name="istplnotice" value="1" id="isshow1" {if $setting['istplnotice'] == 1}checked="true"{/if} /> 是</label>
                        &nbsp;&nbsp;&nbsp;
                        <label for="isshow2" class="radio-inline"><input type="radio" name="istplnotice" value="0" id="isshow2"  {if empty($setting) || $setting['istplnotice'] == 0}checked="true"{/if} /> 否</label>
                        <span class="help-block"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">订单状态提醒模版ID</label>
                    <div class="col-sm-9">
                        <input type="text" name="tplneworder" value="{$setting['tplneworder']}" class="form-control"/>
                        <div class="help-block">
                            在模板库选择行业餐饮－餐饮，搜索“订单状态提醒”编号为OPENTM202045454的模板
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">排队通知模版ID</label>
                    <div class="col-sm-9">
                        <input type="text" name="tplnewqueue" value="{$setting['tplnewqueue']}" class="form-control"/>
                        <div class="help-block">
                            在模板库选择行业餐饮－餐饮，搜索“排号通知”编号为OPENTM383288748的模板
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
        <div class="panel-heading">
            邮件设置
        </div>
        <div class="panel-body">
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">邮箱提醒</label>
                <div class="col-sm-9">
                    <label for="email_enable" class="radio-inline"><input type="radio" name="email_enable" value="1" id="email_enable" {if $setting['email_enable']==1}checked{/if} /> 是</label>
                    &nbsp;&nbsp;&nbsp;
                    <label for="email_enable2" class="radio-inline"><input type="radio" name="email_enable" value="0" id="email_enable2"  {if $setting['email_enable']==0 || empty($setting)}checked{/if} /> 否</label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">邮箱服务器</label>
                <div class="col-sm-9">
                    <select name="email_host" class="form-control">
                        <option value="smtp.qq.com" {if $setting['email_host'] == 'smtp.qq.com' } selected="selected"{/if}>QQ邮箱</option>
                        <option value="smtp.126.com" {if $setting['email_host'] == 'smtp.126.com' } selected="selected"{/if}>126邮箱</option>
                        <option value="smtp.163.com" {if $setting['email_host'] == 'smtp.163.com' } selected="selected"{/if}>163邮箱</option>
                        <option value="smtp.sina.com" {if $setting['email_host'] == 'smtp.sina.com' } selected="selected"{/if}>sina邮箱</option>
                    </select>
                    <div class="help-block">QQ邮箱务必开启smtp服务</div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">发件人名称</label>
                <div class="col-sm-9">
                    <input type="text" name="email_user" class="form-control" value="{if empty($setting['email_user']) || empty($setting)}智慧餐厅{else}{$setting['email_user']}{/if}" />
                    <div class="help-block">指定发送邮件发信人名称</div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">发送帐号用户名</label>
                <div class="col-sm-9">
                    <input type="text" name="email_send" class="form-control" value="{$setting['email_send']}" />
                    <div class="help-block">指定发送邮件的用户名，例如：123456@qq.com</div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">发送帐号密码</label>
                <div class="col-sm-9">
                    <input type="password" name="email_pwd" class="form-control" value="{$setting['email_pwd']}" />
                    <div class="help-block">指定发送邮件的密码</div>
                </div>
            </div>
        </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                短信设置
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商户短信提醒</label>
                    <div class="col-sm-9">
                        <label for="sms_enable" class="radio-inline"><input type="radio" name="sms_enable" value="1" id="sms_enable" {if $setting['sms_enable']==1}checked{/if} /> 是</label>
                        &nbsp;&nbsp;&nbsp;
                        <label for="sms_enable2" class="radio-inline"><input type="radio" name="sms_enable" value="0" id="sms_enable2"  {if $setting['sms_enable']==0 || empty($setting)}checked{/if} /> 否</label>
                        <div>
                            使用短信提醒必须申请接口才能使用 <a href="http://www.dxton.com/" target="_blank">申请网址查看这里</a>.
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">短信平台帐号</label>
                    <div class="col-sm-9">
                        <input type="text" name="sms_username" class="form-control" value="{$setting['sms_username']}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">短信平台密码</label>
                    <div class="col-sm-9">
                        <input type="password" name="sms_pwd" class="form-control" value="{$setting['sms_pwd']}" />
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group col-sm-12">
            <input type="hidden" name="id" value="{$setting['id']}" />
            <input type="submit" name="submit" value="保存设置" class="btn btn-primary col-lg-1" />
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
	    <input type="hidden" name="id" value="{$setting['id']}" />
	</form>
</div>
{template 'common/footer'}